﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LinqDataSourceDemo.aspx.cs" Inherits="LinqDataSourceDemo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>

            <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="TestDBDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName="" TableName="MyInfo">
            </asp:LinqDataSource>
            <br />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="LinqDataSource1" PageSize="2">
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                    <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" />
                    <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                    <asp:BoundField DataField="Content" HeaderText="Content" SortExpression="Content" />
                    <asp:BoundField DataField="Publish_Time" HeaderText="Publish_Time" SortExpression="Publish_Time" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="Click_Number" HeaderText="Click_Number" SortExpression="Click_Number" />
                    <asp:BoundField DataField="Category_Mark" HeaderText="Category_Mark" SortExpression="Category_Mark" />
                </Columns>
            </asp:GridView>

        </div>
    </form>
</body>
</html>
